﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using PressMenu2;


class COptionGame
{
    MyInput input;
    int i_MucDo = 2;
    bool b_De = false;
    bool b_TrungBinh = true;
    bool b_Kho = false;
    Texture2D background, de, trungbinh, kho, onoff;
    Texture2D t_mouse;
    int mouseX = 0; int mouseY = 0;
    public void LoadContent(ContentManager content)
    {
        input = new MyInput();
        t_mouse = content.Load<Texture2D>(@"Img\control_mouse");
        background = content.Load<Texture2D>(@"Img\ImgOption\backgroundoption");
        de = content.Load<Texture2D>(@"Img\ImgOption\de");
        trungbinh = content.Load<Texture2D>(@"Img\ImgOption\trungbinh");
        kho = content.Load<Texture2D>(@"Img\ImgOption\kho");
        onoff = content.Load<Texture2D>(@"Img\ImgOption\onoff");
    }
    public void Update()
    {
        input.Update();
        mouseX = input.Mouse.X;
        mouseY = input.Mouse.Y;
        if((input.Mouse.X > 400)& (input.Mouse.X < 550)&(input.Mouse.Y > 150)&(input.Mouse.Y < 215))
            if(input.Mouse.IsLeftClick())
            {
                b_De = true;
                b_TrungBinh = false;
                b_Kho = false;
            }
        if ((input.Mouse.X > 400) & (input.Mouse.X < 550) & (input.Mouse.Y > 215) & (input.Mouse.Y < 279))
            if (input.Mouse.IsLeftClick())
            {
                b_De = false;
                b_TrungBinh = true;
                b_Kho = false;
            }
        if ((input.Mouse.X > 400) & (input.Mouse.X < 550) & (input.Mouse.Y > 279) & (input.Mouse.Y < 350))
            if (input.Mouse.IsLeftClick())
            {
                b_De = false;
                b_TrungBinh = false;
                b_Kho = true;
            }
    }
    public void Show(SpriteBatch sb)
    {
        
        sb.Draw(background, new Vector2(0, 0), Color.White);
        sb.Draw(onoff, new Vector2(400, 150), Color.White);
        if ( b_De == false)
            sb.Draw(de, new Vector2(402, 150), Color.White);
        else
            sb.Draw(de, new Vector2(480, 150), Color.White);
        if(b_TrungBinh == false)
            sb.Draw(trungbinh, new Vector2(402, 215), Color.White);
        else
            sb.Draw(trungbinh, new Vector2(480, 215), Color.White);
        if(b_Kho == false)
            sb.Draw(kho, new Vector2(402, 279), Color.White);
        else
            sb.Draw(kho, new Vector2(480, 279), Color.White);
        sb.Draw(t_mouse, new Vector2(mouseX, mouseY), Color.White);
    }
}

